a   =[ 0  0  0  0    1  1  1  0    1  1  1  1    0  0  1  0    1  1  0  0  ... 
       1  0  0  1    0  0  0  0    0  0  1  0    0  0  1  0    0  1  1  0  ...
       0  0  1  0    1  1  1  0    1  0  1  1    0  1  1  0    0  0  0  0  ...
       1  1  0  0    1  1  0  1    0  1  0  0    1  1  1  0    0  1  1  1  ...
       1  0  1  1    0  1  0  0    0  0  1  0    1  0  1  0    1  1  1  1  ...
       1  0  1  0    0  1  0  1    0  0  0  1    1  0  1  1    1  0  0  0  ...
       1  1  1  1    1  1  1 ];

p_n =[ 1  1  1  1   -1 -1 -1  1   -1 -1 -1 -1    1  1 -1  1   -1 -1  1  1  ...
      -1  1  1 -1    1  1  1  1    1  1 -1  1    1  1 -1  1    1 -1 -1  1  ...
       1  1 -1  1   -1 -1 -1  1   -1  1 -1 -1    1 -1 -1  1    1  1  1  1  ...
      -1 -1  1  1   -1 -1  1 -1    1 -1  1  1   -1 -1 -1  1    1 -1 -1 -1  ...
      -1  1 -1 -1    1 -1  1  1    1  1 -1  1   -1  1 -1  1   -1 -1 -1 -1  ...
      -1  1 -1  1    1 -1  1 -1    1  1  1 -1   -1  1 -1 -1   -1  1  1  1  ...
      -1 -1 -1 -1   -1 -1 -1 ];

 P   =[1; -1; 1; 1];
 
 pils= repmat(P,1,length(p_n)) .* repmat(p_n, length(P),1);
